<template>
  <a-select style="width: 100%" @change="handleChange" v-model="currentValue">
    <a-select-option v-for="item in options" :value="item.value" :key="item.value">
      {{ item.label }}
    </a-select-option>
  </a-select>
</template>
<script>
import { ROLE_LIST } from '@/const/const'
export default {
  props: {
    value: {
      type: String,
      default: ''
    },
  },
  data() {
    return {
      options: ROLE_LIST,
      currentValue: this.value
    }
  },
  watch: {
    value(newValue, oldValue) {
      this.currentValue = newValue
    }
  },
  methods: {
    handleChange(value) {
      console.log(`selected ${value}`)
    }
  }
}
</script>
